package runner;

import java.io.File;
import peste.Obiect;
import peste.Om;
import load.XMLtoModel;
import model.HouseModel;
import model.ObjectModel;
import model.PersonModel;
import model.RoomModel;
public class MainClass {
	String[] actiuni={"Turns everything off", "wakes up in", "opens window", "closes window", "goes to bed", "leaves","comes home","drinks", "is resting","takes a bath", "showers","eats","washes","uses","turns on", "turns off", "sets"};
	static String[] obiecte=new String[100];
	static String[] persoane=new String[10];
	static String[] camere=new String[30];
/*	public static void getobjects(){
		int z=0;
	
		for(int i=0;i<HouseModel.roomList.size();i++){
			RoomModel currentModel=HouseModel.roomList.get(i);
			for(int j=0;j<currentModel.getObjectList().size();j++)
			{ObjectModel current=HouseModel.roomList.get(i).getObjectList().get(j);
			obiecte[z++]=current.getName();
		}}
			for(int i=0; i<z; i++)
				System.out.println(obiecte[i]+" ");
	}
	*/
	public static void getshrooms(){int z=0;
		for(int i=0;i<HouseModel.roomList.size();i++){
			RoomModel currentModel=HouseModel.roomList.get(i);
			camere[z++]=currentModel.getName();}
		for(int i=0; i<z; i++)
			System.out.println(camere[i]);
			
		
	}
	
	public static void main(String args[])
	{int z=0;
		XMLtoModel.loadFamily(new File("family.xml"));
		XMLtoModel.loadHouse(new File("house.xml"));
		for(int i=0;i<HouseModel.roomList.size();i++){
			RoomModel currentModel=HouseModel.roomList.get(i);
			System.out.println("Objects in room: "+currentModel.getName());
			for(int j=0;j<currentModel.getObjectList().size();j++)
				{ObjectModel current=HouseModel.roomList.get(i).getObjectList().get(j);
				if(current.getType().equalsIgnoreCase("Sink")) current.setActive(true);
				System.out.println(current.getName()+" "+current.isActive());
				}}
		
		for(int i=0;i<PersonModel.list.size();i++){
			
			PersonModel currentModel=PersonModel.list.get(i);
			System.out.println("Persons in house: "+currentModel.getName()+" de varsta "+currentModel.getAge()+" de sexul "+currentModel.getSex());
			String numePersonaj=currentModel.getName();
			persoane[z++]=numePersonaj;
			//for(int j=0;j<currentModel.getObjectList().size();j++)
				//{ObjectModel current=HouseModel.roomList.get(i).getObjectList().get(j);
				//if(current.getType().equalsIgnoreCase("Sink")) current.setActive(true);
				//System.out.println(current.getName()+" "+current.isActive());
				}
		peste.Obiect.getobjects();
	/////////verificam daca mere => mere
		for(int i=0;i<HouseModel.roomList.size();i++){
			RoomModel currentModel=HouseModel.roomList.get(i);
			System.out.println("Objects in room: "+currentModel.getName());
			for(int j=0;j<currentModel.getObjectList().size();j++)
				{ObjectModel current=HouseModel.roomList.get(i).getObjectList().get(j);
				System.out.println(current.getType()+" "+current.isUses()+" "+current.isTurns()+" "+current.isSets());
				}
		}
	///verificam oamenii (ce pot face)
		peste.Om.personalizare();
			for(int i=0;i<PersonModel.list.size();i++){
				
				PersonModel current=PersonModel.list.get(i);
				System.out.println(current.getName()+":");
				for(int j=0; j<17; j++) {
					System.out.println("");
					System.out.println(current.actiuni[j]+" "+current.getPoate(j));
				System.out.println(current.obiecte[j]+" "+current.getBroasca(j));
				
			}
				peste.Om.fish();
				
	getshrooms();
	
	}}}
